const fs = require('fs');
const path = require('path');
const now = new Date();
const time = `${now.getFullYear()}-${(now.getMonth()+1).toString().padStart(2, '0')}-${now.getDate().toString().padStart(2, '0')} ${now.getHours().toString().padStart(2, '0')}:${now.getMinutes().toString().padStart(2, '0')}:${now.getSeconds().toString().padStart(2, '0')}`;

const content = `export default '${time}';`;
const outputPath = path.join(__dirname, 'src/utils/buildTime.js');

fs.writeFileSync(outputPath, content);
console.log('编译时间已更新：', time);